<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <link rel="stylesheet" href="/css/webPage/index.css">
</head>
<body>
<%- include ("../publicEjs/public.ejs")%>
<div class="all">
    <div class="container">
        <div class="main">
            <div class="top"></div>

                <%for(var i=0;i<list[0].length;i++) { %>
                <% if (list[0][i].status==0) { %>
                    <div class="center" onclick="show()">
                        <h2><%=list[0][i].test_name%></h2>
                        <div class="time">
                            <div class="kaiKao">开考时间：<span><%=list[0][i].start_time%></span></div>
                            <div class="jieZhi">截止时间：<span><%=list[0][i].end_time%></span></div>
                            <div style="clear: both"></div>
                        </div>
                        <div class="zhuYi">注意：请准时参加考试，保证考试期间网络状态良好 , 截止时间将自动交卷。</div>
                    </div>

                    <% } else if  (list[0][i].status==1) { %>
                <a href="/admin/exam?test_number=<%=list[0][i].test_number%>">
                <div class="center" >
                    <h2><%=list[0][i].test_name%></h2>
                    <div class="time">
                        <div class="kaiKao">开考时间：<span><%=list[0][i].start_time%></span></div>
                        <div class="jieZhi">截止时间：<span><%=list[0][i].end_time%></span></div>
                        <div style="clear: both"></div>
                    </div>
                    <div class="zhuYi">注意：请准时参加考试，保证考试期间网络状态良好 , 截止时间将自动交卷。</div>
                </div>
            </a>
            <% } else if (list[0][i].status==2) { %>
<!--            成绩查询-->
            <div class="result">
                <h2>成绩查询</h2>
                <div class="grade">
                    <h2>您在<%=list[0][i].test_name%>中的最终成绩为：</h2>
                    <h1><%=list[1]%></h1>
                </div>
                <a href="/admin/analysis?test_number=<%=list[0][i].test_number%>">
                    <div class="analysis">试卷解析</div>
                </a>
            </div>
                <% } else if (list[0][i].status==-1) { %>
                        <div class="center" onclick="no()">
                        <h2><%=list[0][i].test_name%></h2>
                        <div class="time">
                            <div class="kaiKao">开考时间：<span><%=list[0][i].start_time%></span></div>
                            <div class="jieZhi">截止时间：<span><%=list[0][i].end_time%></span></div>
                            <div style="clear: both"></div>
                        </div>
                        <div class="zhuYi">注意：请准时参加考试，保证考试期间网络状态良好 , 截止时间将自动交卷。</div>
                    </div>
            <% } else { %>
                <div class="result" style="height: 75px ;margin-top: 0">
                    <h2>没有考试</h2>
                </div>
        </div>
            <% } %>
        <% } %>
    </div>
</div>
<%- include ("../publicEjs/foot.ejs")%>

<script src="/js/jquery.js"></script>
<script src="/js/webPage/index.js"></script>

<script>
    function show() {
        alert("考试还未开始，请耐心等待")
        window.onload;
    }
    function no() {
        alert("您已提交试卷！")
        window.onload;
    }
</script>
</body>
</html>
